<template>
  <view class="change">
    <view class="change-header">
      <view class="change-header-text">预算报价变更单费用合计</view>
      <view class="change-header-money">¥{{ totalMoney }}</view>
    </view>
    <CardDetails title="退货单" :obj-item="returnOrder"/>
    <CardDetails title="换补单" :obj-item="replacementOrder"/>
  </view>
</template>
<script setup>
import {ref} from "vue"
import CardDetails from "@/components/cardDetails/index"
import {getExchange} from "@/api/contract";
import {onLoad} from "@dcloudio/uni-app";
const returnOrder = ref({}) // 退货单详情
const replacementOrder = ref({}) // 换补单详情
const totalMoney = ref() // 换补单详情
onLoad((option) => {
  getExchangeList(option.budgetId||'')
})
const getExchangeList = async (budgetId) => {
  const {data} = await getExchange({budgetId})
  returnOrder.value = data.returnOrder||{}
  replacementOrder.value = data.replacementOrder||{}
  totalMoney.value = data.totalMoney || 0.00
}
</script>
<style scoped lang="scss">
@import "index";
</style>